<div id="dt_example">
    <div id="container">
        <div id="demo"
             <div style="font-size: 15px;font-style: oblique;font-weight: bold;margin-bottom: 10px;">Sections Table</div>
             <div style="font-size: 15px;font-style: oblique;font-weight: bold;margin-bottom: 10px;margin: 20px;">
                 <a href ="#" onclick="load_link('index.php?page=CMS&action=createSection',load_validation)">Create Sections</a>
             </div>
            <table cellpadding="0" cellspacing="0" border="0" class="display" id="example">
                <thead>
                    <tr>
                        <th>Name</th>
                        <th>Section Status</th>
                        <th>Section type</th>
                        <th>order</th>
                        <th>Edit Section</th>
                    </tr>
                </thead>
                <tbody>
                    <?php
                    foreach($sections as $section){
                    echo"<tr>";
                        echo "<td>{$section->name}</td>";
                        $status=$section->status_==0?'Closed':"Open";
                        echo "<td> <a href='#' onclick='$(this).load(\"index.php\",\"page=CMS&action=changeStatus&module=section\")'>{$status}</a></td>";
                        echo "<td>{$section->type->name}</td>";
                        echo "<td>{$section->order_}</td>";
                        echo "<td><a href ='#' onclick='load_link(\"index.php?page=CMS&action=createSection&id={$section->id}\",load_validation)'>Edit</a></td>";
                        echo"</tr>";
                    }
                    ?>
                </tbody>
            </table>
        </div>
    </div>
</div>